/**
 * 
 */
var navs = [{
	title: '首页',
	icon: 'icon-shouye',
	url: '/',
	active: '',
	badge: 0
}, {
	title: '下单',
	icon: 'icon-gouwuche',
	url: '/order',
	active: '',
	badge: 0
}, {
	title: '我的',
	icon: 'icon-account',
	url: '/center',
	active: '',
	badge: 0
}]

$(document).on('ajaxStart', function() {
	$.showPreloader();
}).on('ajaxStop', function() {
	$.hidePreloader();
});

//添加请求拦截器
axios.interceptors.request.use(function (config) {
    return config;
  }, function (error) {
    return error;
  });

// 添加响应拦截器
axios.interceptors.response.use(function (response) {
	if (!response.data.success) {
		if ($.isArray(response.data.message) && response.data.message.length > 1) {
			$.alert(response.data.message.join('<br>'));
		} else {
			$.toast(response.data.message);
		}
	}
    return response;
  }, function (error) {
	if (error.response.status = 403) {// 无权限访问
		$.toast('您无访问权限，请重新登录。');
	}
    return error;
  });
